export function flattenTranslations(translations, prefix = "") {
  const result = {};

  for (const key in translations) {
    if (translations.hasOwnProperty(key)) {
      const value = translations[key];
      const newKey = prefix ? `${prefix}.${key}` : key;

      if (typeof value === "object" && value !== null) {
        Object.assign(result, flattenTranslations(value, newKey));
      } else {
        result[newKey] = value;
      }
    }
  }

  return result;
}
